package com.twohand.admin.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.twohand.admin.Dto.OrderCountDto;
import com.twohand.admin.Entity.Salesman;
import com.twohand.admin.Vo.OrderCountVo;
import com.twohand.admin.Vo.SelectOptions;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface SalesmanMapper extends BaseMapper<Salesman> {
    @Update("update salesman set is_default = 0")
    Integer allNoDefault();
    @Update("update salesman set is_default = 1 where id = #{id}")
    Integer setDefault(Integer id);
    @Select("select name as label, id as value from salesman order by is_default desc")
    List<SelectOptions> getSalesOptions();

    List<OrderCountVo> getOrderCount(String startTime,String endTime,Integer sid);
}
